package com.ruoyi.door.controller.app.wxtemplate;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.door.utils.WxTemplate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "APP 模板消息", tags = "APP 模板消息")
@RestController
@Slf4j
@RequestMapping("/app-api/template")
public class AppWxTemplateController {
    @Autowired
    private WxTemplate wxTemplate;

    @ApiOperation(value = "人联模板", notes = "人联模板")
    @GetMapping("/renLian")
    @Anonymous
    public String renLian(String openId, String address, String phone, String jiaofeixiang, String amount) {
        return wxTemplate.renLian("",openId, address, phone, jiaofeixiang, amount);
    }

    @ApiOperation(value = "门禁卡模板", notes = "门禁卡模板")
    @GetMapping("/menJinKa")
    @Anonymous
    public String menJinKa(String openId, String address, String phone, String bishu, String amount) {
        return wxTemplate.menJinKa("",openId, address, phone, bishu, amount);
    }

    @ApiOperation(value = "运维费模板", notes = "运维费模板")
    @GetMapping("/yunWeiFei")
    @Anonymous
    public String yunWeiFei(String openId, String mjbm, String address, String phone, String amount) {
        return wxTemplate.yunWeiFei("",openId, mjbm, address, phone, amount);
    }
}
